<?php
/**
 *  Por Federico Pisarello - SisDev Software (c) 2012 - Buenos Aires, Argentina.
 * 	fpisarello@sisdevsoft.com
 */

//Quiero todo en utf-8
header('Content-Type: text/html; charset=UTF-8');

require_once("../../includes/selectLanguage.php");
require_once("../../includes/funciones.inc.php");
require_once("../../includes/constants.php");

$DB = NewADOConnection('mysqlt');
$DB->Connect();
$DB->Execute("SET NAMES utf8;");
//$DB->debug=true;

if(isset($_REQUEST["id"]))
{
	//User Query
	$rsUser = $DB->Execute("SELECT * FROM users WHERE userState <> '$stateErase' AND idUser = ". $_REQUEST["id"]);
	if($rs->EOF) die();
	//Restaurant Query
	$rsRestaurant = $DB->Execute("SELECT * FROM restaurant WHERE idRestaurant = " . $rsUser->fields("idRestaurant") . "' AND state <> '$stateErase'");
	if($rsRestaurant->EOF) die();
	
	$mcrypt = new MCrypt();
	$decryptedPass = $mcrypt->decrypt($rsUser->fields("userPassword"));
}
else
	die();

?>
<!DOCTYPE HTML>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html" />
	<style>
		[hidden]{display:none}
		html{font-size:100%}
		body,figure,form{margin:0}
		p,pre,dl,menu,ol,ul{margin:1em 0}
		input{outline:none;}
		html{font-family: Verdana, sans-serif;}
		body{background: url('<?=$basedir?>/imagenes/bg.gif');}
		.clear{clear: both;}
		#logDer{float: right;width: 215px;}
		#contHeader{width:1024px;position:absolute;top:0;left:251px;}
		#sidebar{position:absolute;height:100%;width:251px;background-image: url('<?=$basedir?>/imagenes/bgSidebar.png');}
		.userHead{margin-left:55px;}
		.logoSide{display: block;margin: 50px auto 0;}
		#closeSe{text-align:center;padding-top:160px;font-family:Lora, serif;color:#2C2B2D;}
		#nomUsuario{font-size:28px;font-weight:bold;margin-bottom:20px;}
		#contenido{padding: 38px 0px 0px 251px;}
		#tituloSec{font-size:27px;color: #055D9B;margin-left:30px;text-transform:uppercase;}
		#contHead{border-bottom:1px solid #C1B0A2;height:45px;margin-bottom : 20px;}
		#cuerpo span {margin-left:30px;font-weight: bold;}
		#cuerpo p {margin-left:50px;}
	</style>
</head>

<body>
	<div id="sidebar">
		<img src="<?=$basedir?>/imagenes/logoSide.png" class="logoSide">
	</div>

	<div id="contenido">
		<div id="contHead">
			<div id="tituloSec"><?=$a_languages["MailDemo.Title"];?></div>
		</div>
		<div id="cuerpo">
			<span>
				<?=$a_languages["MailDemo.Thanks"];?>
				<?=$rsUser->fields("userCompleteName");?>
				<?=$a_languages["MailDemo.Interest"];?>
			</span>
			<br/>
			<br/>
			<p><?=$a_languages["MailDemo.AccessService"];?><p>
			<p><?=$a_languages["MailDemo.Link"];?><?=$a_languages["Common.URL"];?></p>
			<p><?=$a_languages["MailDemo.User"];?><?=$rsUser->fields("userName");?> <?=$a_languages["MailDemo.Password"];?><?=$decryptedPass;?></p>
			<br/>
			<br/>
			<p><?=$a_languages["MailDemo.CotactMsg"];?></p>
			<p><?=$a_languages["MailDemo.MailDemo1"];?></p>
			<p><?=$a_languages["MailDemo.MailDemo2"];?></p>
			<br/>
			<br/>
			<br/>			
			<span><?=$a_languages["MailDemo.Atte"];?></span>
		</div>
	</div>
</body>

</html> 
